package problems.onemax;

import problems.Problem;
import ec.BitSolution;
import ec.FitnessEvaluator;
import ec.Solution;

public class OneMaxProblem extends Problem {
	public static int num_bits = 100;
	
	public static void main(String[] args) {
		Problem problem = new OneMaxProblem();
		int num_runs = 30;
		int num_batches = 100;
		int batch_size = 200;
		problem.ec("data/onemax" + num_bits + "/", num_runs, num_batches, batch_size, 7, 25, 75, 10);
		problem.randomSearch("data/onemax" + num_bits + "/", num_runs, num_batches, batch_size);
	}

	@Override
	protected Solution createRandomSolution() {
		return new BitSolution(num_bits, .001);
	}

	@Override
	public FitnessEvaluator getFitnessEvaluator() {
		return new OneMaxFitnessEvaluator();
	}
}
